﻿@{
    ViewBag.Title = "订单详情";
    Layout = "~/Views/Shared/_MobileLayout.cshtml";
    var order = ViewBag.OrderDetails as LPY.LeHealth.DTO.Order;
    var peoples = ViewBag.PhysicalPeoples as List<LPY.LeHealth.DTO.PhysicalPeople>;
}

<ol class="breadcrumb">
    <li><a href="@Url.Action("UserCenter","Mobile")"><i class="fa fa-user"></i> 用户中心</a></li>
    <li><a href="@Url.Action("OrderManager","Mobile")">我的订单</a></li>
    <li>订单明细</li>
</ol>

<div class="panel panel-default" style="padding-bottom:0px;margin-top:10px;">
    <div class="panel-heading"><b>订单编号：@order.Ordercode</b></div>
    <div class="panel-body" style="padding-bottom:0px;">
        <p>订单价格：￥@Math.Round(order.SumPrice, 2)</p>
        <p>创建时间：@order.CreateDate</p>
        @*订单状态*@
        @switch (order.State)
        {
            case 0:
                <p>订单状态：<span class="label label-success">待支付</span></p>
                break;
            case 1:
            <p>订单状态：<span class="label label-success">待预约</span></p>
                break;
            case 2:
            <p>订单状态：<span class="label label-success">待体检</span></p>
                break;
            default:
            case 3:
            <p>订单状态：<span class="label label-success">体检完成</span></p>
                break;
        }
        <hr />
        @*订单联系人*@
        <p>预订人姓名：@order.BookerName</p>
        <p>联系方式：@order.BookerPhone</p>

        <hr />
        <p><b>套餐详细信息</b></p>
        @*套餐详细信息*@
        @for (int i = 0; i < order.Details.Count; i++)
        {

            <div class="row">
                <div class="col-xs-4">
                    <a href="@Url.Action("ComboDetail", "Mobile", new { id = order.Details[i].ComboId })">
                        <img class="img-rounded pull-left img-responsive" src="/Asset/tijian.png">
                    </a>
                </div>
                <div class="col-xs-8">
                    <p>
                        <strong><a title="@order.Details[i].Combo.Name" href="@Url.Action("ComboDetail", "Mobile", new { id = order.Details[i].ComboId })">@order.Details[i].Combo.Name</a></strong>
                    </p>
                    <p>@order.Details[i].Combo.Hospital.Name</p>
                    <p class="priceinfo">
                        <b>¥<strong>@Math.Round(order.Details[i].Combo.Price)</strong></b>
                    </p>
                </div>
            </div>
        }

        <hr />
        @*预约人信息*@
        <p><b>预约人信息</b></p>
        @if (null == peoples || peoples.Count == 0)
        {
            <tr>无预约人信息</tr>
        }
        else
        {
            <table class="table table-striped" cellpadding="0" cellspacing="0" border="0">
                <tbody>
                    <tr>
                        <th scope="col">姓名</th>
                        <th scope="col">联系方式</th>
                        <th scope="col">预约时间</th>
                    </tr>

                    @for (int i = 0; i < peoples.Count; i++)
                    {
                        <tr>
                            <td>@peoples[i].Name</td>
                            <td>@peoples[i].Phone</td>
                            <td>@peoples[i].AppointmentTime.ToString("yyyy-mm-dd hh:MM")</td>
                        </tr>
                    }

                </tbody>
            </table>
        }
        @*订单操作*@
        @switch (order.State)
        {
            case 0:
                <p class="pull-right">
                    <a class="btn btn-primary btn-sm" href="@Url.Action("Pay", "Mobile", new { id = order.Id })">去付款</a>
                </p>
                break;
            case 1:
            <p class="pull-right">
                <a class="btn btn-primary btn-sm" style="margin-left:10px;" href="@Url.Action("Appointment", "Mobile", new { id = order.Id })">去预约</a>
            </p>
                break;
        }
    </div>
</div>